fix(deps): promote markdown to a core dependency so rich delivery works out of the box (#32486) - #38649
Merged
Conversation
🔎 Lint report:
|
…ks out of the box (#32486) `markdown` was declared only in the `matrix` optional extra, and the official Docker image installs `--extra all --extra messaging --extra anthropic --extra bedrock --extra azure-identity --extra hindsight` — notably NOT `--extra matrix` (the matrix extra is deliberately routed to lazy-install because `mautrix[encryption]`/`python-olm` can't build on Windows/macOS — see the 2026-05-12 policy comment in `[all]`). Result: `markdown` never lands in the image venv, so the Markdown->HTML conversion on the DEFAULT delivery path silently falls back to plain text. Cron/agent deliveries render raw `##`/`**`/tables in clients like Element (no `formatted_body`). The conversion is now used by BOTH `gateway/platforms/matrix.py` and `tools/send_message_tool.py`, so it is no longer matrix-specific. `markdown` is a pure-Python `py3-none-any` wheel (~108KB, no compiled extensions, no platform constraints), so none of the reasons the matrix extra was lazy-routed apply to it. Promote it to a core dependency so it ships in the wheel, the Docker image, and every install; drop the now redundant copies from the `matrix` extra and the `platform.matrix` lazy-deps group; refresh the stale "installed with the matrix extra" docstring. Verified against a real build: ran the image's exact `uv sync` command (same extras, no `--extra matrix`) in a clean container off the new lockfile -> `import markdown` succeeds (3.10.2). On `origin/main` the same command leaves markdown absent. 223 targeted tests pass (test_matrix.py + test_lazy_deps.py). Closes #32486.
benbarclay
force-pushed
the
fix/markdown-core-dep
branch
from
June 4, 2026 03:20
bca33fb to
b5a3d6a
Compare
benbarclay
enabled auto-merge (squash)
June 4, 2026 23:44
teknium1
approved these changes
Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #32486.
Problem
markdownwas declared only in thematrixoptional extra. The official Docker image installs:— notably without
--extra matrix. The matrix extra is deliberately routed to lazy-install becausemautrix[encryption]→python-olmcan't build on Windows/macOS (see the 2026-05-12 policy comment in[all]).So
markdownnever lands in the image venv, and the Markdown→HTML conversion on the default delivery path silently falls back to plain text. Cron/agent deliveries render raw##/**/ tables in clients like Element (the Matrix event has noformatted_body). The conversion is now used by bothgateway/platforms/matrix.pyandtools/send_message_tool.py, so it is no longer matrix-specific — even non-matrix users hit the silent fallback.Fix
markdownis a pure-Pythonpy3-none-anywheel (~108 KB, no compiled extensions, no platform constraints), so none of the reasons the matrix extra was lazy-routed apply to it. This PR:Markdown==3.10.2to a core dependency so it ships in the wheel, the Docker image, and every install.matrixextra and theplatform.matrixlazy-deps group (single source of truth)._markdown_to_htmldocstring that claimed markdown is "installed with the matrix extra".uv.lock(markdown moves frommarker = "extra == 'matrix'"to an unconditional core dep).This is the architecturally-consistent variant of the issue's Option 2/3: it removes the silent footgun everywhere without dragging the heavy
mautrix/python-olmmatrix stack into core.Verification (real build)
Ran the image's exact
uv synccommand (same extras, no--extra matrix) in a clean container built off the new lockfile:On
origin/main, the same command leavesmarkdownabsent (it's only in the un-passedmatrixextra). Before/after is airtight.Targeted tests:
tests/gateway/test_matrix.py+tests/tools/test_lazy_deps.py→ 223 passed, 0 failed.